<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'view_People.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>pages/news/first_page/style/backstage.css" media="all" />
	<script type="text/javascript" charset="utf-8"
			src="<%=basePath%>/pages/news/js/jquery-1.5.1.min.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  <fieldset class="fieldset">
			<legend class="legend">
				修改用户：
			</legend>
    <form action="<%=basePath%>login_user/modify_news_p" method="post" id="sumbit" class="form">
			<input type="hidden"  value="${newsPeople.id }">
			管理员登录名：&nbsp;&nbsp;&nbsp;
			<input readonly="readonly" type="text" name="newsPeople.name" id="peoplename"
				onkeyup="value = value.replace(/[^\w\.\/]/ig, '');" value="${newsPeople.name }"><br />
			管理员密码：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="password" name="newsPeople.psw"
				onkeyup="value = value.replace(/[^\w\.\/]/ig, '');"><span id="boobleanpsw" class="false"></span><br />
			重复管理员密码：
			<input type="password" name="psw"
				onkeyup="value = value.replace(/[^\w\.\/]/ig, '');"><span id="boobleanpswagin" class="false"></span><br /> 
			管理员类型:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<select name="newsPeople.popleType">
				<option value="1" ${newsPeople.popleType=="1"?"selected":"" }>
					高级管理员
				</option>
				<option value="2" ${newsPeople.popleType=="2"?"selected":"" }>
					一般管理员
				</option>
			</select><br />
			E-mail:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input type="text" name="newsPeople.email" value="${newsPeople.email }"><br />
            <input name="" type="button" onClick="fromsumbit()" value="确定" class="button">
		</form>
		</fieldset>
		<script type="text/javascript">
	$(document).ready(function() {
		$(':password[name="newsPeople.psw"]').blur(function() {
			if($(':password[name="newsPeople.psw"]').val().length<7){
				$('#boobleanpsw').text('输入错误，请输入！');
				$('#boobleanpsw').addClass('false');
			}else{
				$('#boobleanpsw').text('');
				$('#boobleanpsw').removeClass('false');
			}
		})
		$(':password[name="psw"]').blur(function() {
			if($(':password[name="psw"]').val().length<7){
				$('#boobleanpswagin').text('输入错误，请输入！');
				$('#boobleanpswagin').addClass('false');
			}else if($(':password[name="psw"]').val()!=$(':password[name="newsPeople.psw"]').val()){
				$('#boobleanpswagin').text('密码不同！');
				$('#boobleanpswagin').addClass('false');
			}else{
				$('#boobleanpswagin').text('');
				$('#boobleanpswagin').removeClass('false');
			}
		})
	});
	function fromsumbit(){
		if($('#boobleanpswagin').hasClass('false')){
			$('#boobleanpswagin').text('错误！');
		}if($('#boobleanpsw').hasClass('false')){
			$('#boobleanpsw').text('错误！');
		}else if(!$('#boobleanpsw').hasClass('false')&&!$('#boobleanpswagin').hasClass('false')){
			$('#sumbit').submit();
		}
	}
</script>
  </body>
</html>
